var t = {
    props: {
        scrollbarSize: {
            type: Number,
            default: 0
        },
        fixedLeftColumns: {
            type: Array,
            default: function() {
                return [];
            }
        },
        data: {
            type: Array,
            default: function() {
                return [];
            }
        },
        transColumns: {
            type: Array,
            default: function() {
                return [];
            }
        },
        border: {
            type: Boolean,
            default: !1
        },
        showSummary: {
            type: Boolean,
            default: !1
        },
        summaryMethod: {
            type: Function
        },
        sumText: {
            type: String,
            default: "合计"
        },
        headerFooterTableLeft: {
            type: Number,
            default: 0
        },
        handleFooterTableScrollLeft: Function
    },
    data: function() {
        return {
            sums: []
        };
    },
    watch: {
        data: {
            deep: !0,
            immediate: !0,
            handler: function(t, e) {
                var a = this, r = [];
                this.summaryMethod ? r = this.summaryMethod({
                    columns: this.transColumns,
                    data: this.data
                }) : this.transColumns.forEach(function(t, e) {
                    if (0 !== e) {
                        var u = a.data.map(function(e) {
                            return Number(e[t.name]);
                        }), n = [], o = !0;
                        u.forEach(function(t) {
                            if (!isNaN(t)) {
                                o = !1;
                                var e = ("" + t).split(".")[1];
                                n.push(e ? e.length : 0);
                            }
                        });
                        var s = Math.max.apply(null, n);
                        r[e] = o ? "" : u.reduce(function(t, e) {
                            var a = Number(e);
                            return isNaN(a) ? t : parseFloat((t + e).toFixed(Math.min(s, 20)));
                        }, 0);
                    } else r[e] = a.sumText;
                }), this.sums = r;
            }
        }
    }
};

exports.summary = t;